<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <div class="box">
            <img src="../images/tao.png" alt="">
        </div>
    </div>
    <script>
        // 获取标签
        var imgCode = document.querySelector('img');
        //得到元素最近的父节点, 如果找不到父节点就返回null
        console.log(imgCode.parentNode);
    </script>
</body>
</html>